package com.example.Laboratory.Mapper;

import com.example.Laboratory.Entity.Student_competition;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Student_competitionMapper {
    //增加信息
    @Insert("INSERT INTO student_competition(student_competition_time,student_competition_type,student_competition_grade,student_competition_student,student_competition_teacher,student_competition_department)VALUES(#{student_competition_time},#{student_competition_type},#{student_competition_grade},#{student_competition_student},#{student_competition_teacher},#{student_competition_department})")
    int addStudent_competition (Student_competition s);

    //根据id删除信息
    @Delete("DELETE FROM student_competition WHERE student_competition_id=#{student_competition_id}")
    int deleteStudent_competition (int student_competition_id);

    //查找全表信息
    @Select("SELECT * FROM student_competition")
    List<Student_competition> researchStudent_competition ( );


    //用全部信息修改
    @Update("UPDATE student_competition SET student_competition_time=#{student_competition_time},student_competition_type=#{student_competition_type},student_competition_grade=#{student_competition_grade},student_competition_student=#{student_competition_student},student_competition_teacher=#{student_competition_teacher},student_competition_department=#{student_competition_department}WHERE student_competition_id=#{student_competition_id}")
    int reviseStudent_competition (Student_competition s);

}
